package com.time.sky.controller;

import com.time.sky.entity.XHJF;
import com.time.sky.mapper.XHJFMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/XHJF")
public class XHJFController {
    @Autowired
    private XHJFMapper xhjfMapper;
    @ResponseBody
    @RequestMapping("/selectAll")
    public List<XHJF> selectAll(){   return xhjfMapper.selectAll(); }
    @ResponseBody
    @RequestMapping("/select")
    public List<XHJF> selectList(){   return xhjfMapper.selectList(); }
    @RequestMapping("/add")
    public void add(XHJF xhjf){
        xhjfMapper.add(xhjf);
    }
    @RequestMapping("/delete/{xid}")
    public void delete(@PathVariable("xid") int xid){
        xhjfMapper.delete(xid);
    }
    @RequestMapping("/get/{xid}")
    public XHJF getById(@PathVariable("xid") int xid){
        return xhjfMapper.getById(xid);
    }
    @RequestMapping("/update")
    public void update(XHJF xhjf){
        xhjfMapper.update(xhjf);
    }
}
